package com.app.readpdfdemo;

import android.graphics.Point;
import android.net.wifi.WifiManager;
import android.os.Environment;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.WindowManager;
import android.widget.ListView;

import com.artifex.mupdf.MuPDFCore;
import com.artifex.mupdf.MuPDFPageAdapter;
import com.artifex.mupdf.MuPDFPageView;

public class MainActivity extends AppCompatActivity{

    private ListView mListView;

    @Override
    protected void onCreate(Bundle savedInstanceState){
        super.onCreate(savedInstanceState);
        getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
                WindowManager.LayoutParams.FLAG_FULLSCREEN);
        setContentView(R.layout.activity_main);
        mListView = (ListView) findViewById(R.id.listview_main);
        String path = Environment.getExternalStorageDirectory()
                .getAbsolutePath()+"/reportpdf/14703881273254.pdf";
        MuPDFCore core = null;
        try{
            core = new MuPDFCore(this,path);
        }catch (Exception e){

        }
        MuPDFPageAdapter adapter = new MuPDFPageAdapter(this, core);
        mListView.setAdapter(adapter);

//        MuPDFPageView pdfPageView = (MuPDFPageView) findViewById(R.id.pdfPageView);
//        MuPDFPageView pdfPageView = new MuPDFPageView(this,core,new Point());

    }
}
